[HZ-5465] Enable lock APIs with Asyncio#820
Open
yuce wants to merge 6 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #820 +/- ##
==========================================
- Coverage 94.22% 94.16% -0.06%
==========================================
Files 411 411
Lines 27427 27511 +84
==========================================
+ Hits 25844 25907 +63
- Misses 1583 1604 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the task ID to be used instead of the thread ID for the asyncio API.
This task ID is produced using:
The builtin
idfunction returns an integer which is guaranteed to be unique among existing objects.The returned id is derived from the memory location of the object in CPython (the only Python implementation we officially support).
See: https://docs.python.org/3/library/functions.html#id
The address space limit for 64bit systems is 52bits (AMD64) to 56bits (ARM64), so the id fits into a long comfortably:
See: https://en.wikipedia.org/wiki/64-bit_computing#Limits_of_processors
Since the task itself is an object, the id can be used as a pseudo-id for the task.
When the task ends, the id can be assigned to another task, but that's not an issue, since the task id is used to distinguish between running tasks.
Updated the
Map,MultiMap, andSemaphoreproxies to use the task ID.